package net.dgg.dggcloud.service.jrcrm.entity.customer;

import net.dgg.dggcloud.core.util.DateUtil;
import net.dgg.dggcloud.core.util.StringUtils;
import net.dgg.dggcloud.service.jrcrm.constant.CustomerAttrConstant;
import net.dgg.dggcloud.service.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @ClassName: AttrCreditCard-客户工作信息
 * @Description: 用于客户工作信息维护
 * @Author: 周潮
 * @Date: 2017年11月03 14:28:28
 * @Version V1.0
 */
@Entity
@Table(name = "cus_attr_job")
public class AttrJob extends BaseEntity {

    //数据库表名
    public static final String TABLE_NAME = "cus_attr_job";

    /**
     * 客户id 
     */
    @Column(name = "customer_id")
    private Long customerId;

    /**
     * 信用卡所有内容前台展示用
     */
    @Transient
    private String frontShow;

    /**
     * 工作性质 
     */
    @Column(name = "job_nature")
    private String jobNature;

    /**
     * 工作性质-前台展示用
     */
    @Transient
    private String jobNatureShow;

    /**
     * 开始经营时间 
     */
    @Column(name = "start_operate_time")
    private Date startOperateTime;

    /**
     * 开始经营时间-前台展示用
     */
    @Transient
    private String startOperateTimeShow;


    /**
     * 经营流水 
     */
    @Column(name = "operating_stream")
    private Double operatingStream;

    /**
     * 经营流水-前台展示用
     */
    @Transient
    private String operatingStreamShow;

    /**
     * 营业执照 1有0无
     */
    @Column(name = "business_license")
    private Integer businessLicense;

    /**
     * 营业执照-前台展示用
     */
    @Transient
    private String businessLicenseShow;

    /**
     * 经营行业 
     */
    @Column(name = "management_industry")
    private String managementIndustry;

    /**
     * 经营行业-前台展示用
     */
    @Transient
    private String managementIndustryShow;

    /**
     * 占股 
     */
    @Column(name = "total_shares")
    private Float totalShares;

    /**
     * 占股-前台展示用
     */
    @Transient
    private String totalSharesShow;

    /**
     * 企业性质 
     */
    @Column(name = "enterprise_nature")
    private String enterpriseNature;

    /**
     * 企业性质-前台展示用
     */
    @Transient
    private String enterpriseNatureShow;

    /**
     * 是否优质企业 1是0否
     */
    @Column(name = "is_quality")
    private Integer isQuality;

    /**
     * 是否优质企业-前台展示用
     */
    @Transient
    private String isQualityShow;

    /**
     * 工资发放形式 
     */
    @Column(name = "wages_pay_form")
    private String wagesPayForm;

    /**
     * 工资发放形式-前台展示用
     */
    @Transient
    private String wagesPayFormShow;

    /**
     * 工资 
     */
    @Column(name = "wages")
    private Double wages;

    /**
     * 工资-前台展示用
     */
    @Transient
    private String wagesShow;

    /**
     * 是否文职军人 1是1否
     */
    @Column(name = "civilian_soldier")
    private Integer civilianSoldier;

    /**
     * 是否文职军人-前台展示用
     */
    @Transient
    private String civilianSoldierShow;

    /**
     * 是否有身份证 1是0否
     */
    @Column(name = "own_id_card")
    private Integer ownIdCard;

    /**
     * 是否有身份证-前台展示用
     */
    @Transient
    private String ownIdCardShow;

    /**
     * 外部系统读取标志 预留扩展字段，每外部系统占用一位，如1001
     */
    @Column(name = "read_flag")
    private String readFlag;

    /**
     * 外部系统来源标志 预留扩展字段，每外部系统占用一位，如1001
     */
    @Column(name = "source_flag")
    private String sourceFlag;

    /**
     * 扩展字段1 
     */
    @Column(name = "ext1")
    private String ext1;

    /**
     * 扩展字段2 
     */
    @Column(name = "ext2")
    private String ext2;

    /**
     * 扩展字段3 
     */
    @Column(name = "ext3")
    private String ext3;

    /**
     * 扩展字段4 
     */
    @Column(name = "ext4")
    private String ext4;

    /**
     * 扩展字段5 
     */
    @Column(name = "ext5")
    private String ext5;

    /**
     * 扩展字段6 
     */
    @Column(name = "ext6")
    private String ext6;

    /**
     * 扩展字段7 
     */
    @Column(name = "ext7")
    private String ext7;

    /**
     * 扩展字段8 
     */
    @Column(name = "ext8")
    private String ext8;

    /**
     * 扩展字段9 
     */
    @Column(name = "ext9")
    private String ext9;

    /**
     * 扩展字段10 
     */
    @Column(name = "ext10")
    private String ext10;

    /**
     * 外部系统读取标志 预留扩展字段，每外部系统占用一位，如1001
     * @return read_flag 外部系统读取标志 预留扩展字段，每外部系统占用一位，如1001
     */
    public String getReadFlag() {
        return readFlag;
    }

    /**
     * 外部系统读取标志 预留扩展字段，每外部系统占用一位，如1001
     * @param readFlag 外部系统读取标志 预留扩展字段，每外部系统占用一位，如1001
     */
    public void setReadFlag(String readFlag) {
        this.readFlag = readFlag == null ? null : readFlag.trim();
    }

    /**
     * 外部系统来源标志 预留扩展字段，每外部系统占用一位，如1001
     * @return source_flag 外部系统来源标志 预留扩展字段，每外部系统占用一位，如1001
     */
    public String getSourceFlag() {
        return sourceFlag;
    }

    /**
     * 外部系统来源标志 预留扩展字段，每外部系统占用一位，如1001
     * @param sourceFlag 外部系统来源标志 预留扩展字段，每外部系统占用一位，如1001
     */
    public void setSourceFlag(String sourceFlag) {
        this.sourceFlag = sourceFlag == null ? null : sourceFlag.trim();
    }

    /**
     * 客户id 
     * @return customer_id 客户id 
     */
    public Long getCustomerId() {
        return customerId;
    }

    /**
     * 客户id 
     * @param customerId 客户id 
     */
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    /**
     * 工作性质 
     * @return job_nature 工作性质 
     */
    public String getJobNature() {
        return jobNature;
    }

    /**
     * 工作性质 
     * @param jobNature 工作性质 
     */
    public void setJobNature(String jobNature) {
        this.jobNature = jobNature == null ? null : jobNature.trim();
    }

    /**
     * 开始经营时间 
     * @return start_operate_time 开始经营时间
     */
    public Date getStartOperateTime() {
        return startOperateTime;
    }

    /**
     * 开始经营时间 
     * @param startOperateTime 开始经营时间
     */
    public void setStartOperateTime(Date startOperateTime) {
        this.startOperateTime = startOperateTime;
    }

    /**
     * 经营流水 
     * @return operating_stream 经营流水 
     */
    public Double getOperatingStream() {
        return (null != operatingStream ? operatingStream/100 : null);
    }

    /**
     * 经营流水 
     * @param operatingStream 经营流水 
     */
    public void setOperatingStream(Double operatingStream) {
        this.operatingStream = (null != operatingStream ? operatingStream*100 : null);
    }

    /**
     * 营业执照 1是1否
     * @return business_license 营业执照 1是1否
     */
    public Integer getBusinessLicense() {
        return businessLicense;
    }

    /**
     * 营业执照 1是1否
     * @param businessLicense 营业执照 1是1否
     */
    public void setBusinessLicense(Integer businessLicense) {
        this.businessLicense = businessLicense;
    }

    /**
     * 经营行业 
     * @return management_industry 经营行业 
     */
    public String getManagementIndustry() {
        return managementIndustry;
    }

    /**
     * 经营行业 
     * @param managementIndustry 经营行业 
     */
    public void setManagementIndustry(String managementIndustry) {
        this.managementIndustry = managementIndustry == null ? null : managementIndustry.trim();
    }

    /**
     * 占股 
     * @return total_shares 占股 
     */
    public Float getTotalShares() {
        return (null != totalShares ? totalShares*100 : null);
    }

    /**
     * 占股 
     * @param totalShares 占股 
     */
    public void setTotalShares(Float totalShares) {
        this.totalShares = (null != totalShares ? totalShares/100 : null);
    }

    /**
     * 企业性质 
     * @return enterprise_nature 企业性质 
     */
    public String getEnterpriseNature() {
        return enterpriseNature;
    }

    /**
     * 企业性质 
     * @param enterpriseNature 企业性质 
     */
    public void setEnterpriseNature(String enterpriseNature) {
        this.enterpriseNature = enterpriseNature == null ? null : enterpriseNature.trim();
    }

    /**
     * 是否优质企业 1是1否
     * @return is_quality 是否优质企业 1是1否
     */
    public Integer getIsQuality() {
        return isQuality;
    }

    /**
     * 是否优质企业 1是1否
     * @param isQuality 是否优质企业 1是1否
     */
    public void setIsQuality(Integer isQuality) {
        this.isQuality = isQuality;
    }

    /**
     * 工资发放形式 
     * @return wages_pay_form 工资发放形式 
     */
    public String getWagesPayForm() {
        return wagesPayForm;
    }

    /**
     * 工资发放形式 
     * @param wagesPayForm 工资发放形式 
     */
    public void setWagesPayForm(String wagesPayForm) {
        this.wagesPayForm = wagesPayForm == null ? null : wagesPayForm.trim();
    }

    /**
     * 工资 
     * @return wages 工资 
     */
    public Double getWages() {
        return (null != wages ? wages/100 : null);
    }

    /**
     * 工资 
     * @param wages 工资 
     */
    public void setWages(Double wages) {
        this.wages = (null != wages ? wages*100 : null);
    }

    /**
     * 是否文职军人 1是1否
     * @return civilian_soldier 是否文职军人 1是1否
     */
    public Integer getCivilianSoldier() {
        return civilianSoldier;
    }

    /**
     * 是否文职军人 1是1否
     * @param civilianSoldier 是否文职军人 1是1否
     */
    public void setCivilianSoldier(Integer civilianSoldier) {
        this.civilianSoldier = civilianSoldier;
    }

    /**
     * 是否有身份证 1是0否
     * @return own_id_card 是否有身份证 1是0否
     */
    public Integer getOwnIdCard() {
        return ownIdCard;
    }

    /**
     * 是否有身份证 1是0否
     * @param ownIdCard 是否有身份证 1是0否
     */
    public void setOwnIdCard(Integer ownIdCard) {
        this.ownIdCard = ownIdCard;
    }

    /**
     * 扩展字段1 
     * @return ext1 扩展字段1 
     */
    public String getExt1() {
        return ext1;
    }

    /**
     * 扩展字段1 
     * @param ext1 扩展字段1 
     */
    public void setExt1(String ext1) {
        this.ext1 = ext1 == null ? null : ext1.trim();
    }

    /**
     * 扩展字段2 
     * @return ext2 扩展字段2 
     */
    public String getExt2() {
        return ext2;
    }

    /**
     * 扩展字段2 
     * @param ext2 扩展字段2 
     */
    public void setExt2(String ext2) {
        this.ext2 = ext2 == null ? null : ext2.trim();
    }

    /**
     * 扩展字段3 
     * @return ext3 扩展字段3 
     */
    public String getExt3() {
        return ext3;
    }

    /**
     * 扩展字段3 
     * @param ext3 扩展字段3 
     */
    public void setExt3(String ext3) {
        this.ext3 = ext3 == null ? null : ext3.trim();
    }

    /**
     * 扩展字段4 
     * @return ext4 扩展字段4 
     */
    public String getExt4() {
        return ext4;
    }

    /**
     * 扩展字段4 
     * @param ext4 扩展字段4 
     */
    public void setExt4(String ext4) {
        this.ext4 = ext4 == null ? null : ext4.trim();
    }

    /**
     * 扩展字段5 
     * @return ext5 扩展字段5 
     */
    public String getExt5() {
        return ext5;
    }

    /**
     * 扩展字段5 
     * @param ext5 扩展字段5 
     */
    public void setExt5(String ext5) {
        this.ext5 = ext5 == null ? null : ext5.trim();
    }

    /**
     * 扩展字段6 
     * @return ext6 扩展字段6 
     */
    public String getExt6() {
        return ext6;
    }

    /**
     * 扩展字段6 
     * @param ext6 扩展字段6 
     */
    public void setExt6(String ext6) {
        this.ext6 = ext6 == null ? null : ext6.trim();
    }

    /**
     * 扩展字段7 
     * @return ext7 扩展字段7 
     */
    public String getExt7() {
        return ext7;
    }

    /**
     * 扩展字段7 
     * @param ext7 扩展字段7 
     */
    public void setExt7(String ext7) {
        this.ext7 = ext7 == null ? null : ext7.trim();
    }

    /**
     * 扩展字段8 
     * @return ext8 扩展字段8 
     */
    public String getExt8() {
        return ext8;
    }

    /**
     * 扩展字段8 
     * @param ext8 扩展字段8 
     */
    public void setExt8(String ext8) {
        this.ext8 = ext8 == null ? null : ext8.trim();
    }

    /**
     * 扩展字段9 
     * @return ext9 扩展字段9 
     */
    public String getExt9() {
        return ext9;
    }

    /**
     * 扩展字段9 
     * @param ext9 扩展字段9 
     */
    public void setExt9(String ext9) {
        this.ext9 = ext9 == null ? null : ext9.trim();
    }

    /**
     * 扩展字段10 
     * @return ext10 扩展字段10 
     */
    public String getExt10() {
        return ext10;
    }

    /**
     * 扩展字段10 
     * @param ext10 扩展字段10 
     */
    public void setExt10(String ext10) {
        this.ext10 = ext10 == null ? null : ext10.trim();
    }

    public void setFrontShow(String frontShow) {
        this.frontShow = frontShow;
    }

    public String getJobNatureShow() {
        return StringUtils.isNotEmpty(jobNature) ? "工作性质【" + jobNature + "】;" : "";
    }

    public void setJobNatureShow(String jobNatureShow) {
        this.jobNatureShow = jobNatureShow;
    }

    public String getStartOperateTimeShow() {

        return null != startOperateTime ? "开始经营时间【" + DateUtil.dateToString(startOperateTime, "yyyy-MM-dd") + "】;" : "";
    }

    public void setStartOperateTimeShow(String startOperateTimeShow) {
        this.startOperateTimeShow = startOperateTimeShow;
    }

    public String getOperatingStreamShow() {
        return null != getOperatingStream() ? "经营流水【" + getOperatingStream() + "万元】;" : "";
    }

    public void setOperatingStreamShow(String operatingStreamShow) {
        this.operatingStreamShow = operatingStreamShow;
    }

    public String getBusinessLicenseShow() {
        if(null != businessLicense){
            return 1 == businessLicense ? "营业执照【有】;" : "营业执照【无】;";
        }else {
            return "";
        }
    }

    public void setBusinessLicenseShow(String businessLicenseShow) {
        this.businessLicenseShow = businessLicenseShow;
    }

    public String getManagementIndustryShow() {
        return null != managementIndustry ? "经营行业【" + managementIndustry + "】;" : "";
    }

    public void setManagementIndustryShow(String managementIndustryShow) {
        this.managementIndustryShow = managementIndustryShow;
    }

    public String getTotalSharesShow() {
        return null != getTotalShares() ? "占股【" + getTotalShares() + "%】;" : "";
    }

    public void setTotalSharesShow(String totalSharesShow) {
        this.totalSharesShow = totalSharesShow;
    }

    public String getEnterpriseNatureShow() {
        return StringUtils.isNotEmpty(enterpriseNature) ? "企业性质【" + enterpriseNature + "】;" : "";
    }

    public void setEnterpriseNatureShow(String enterpriseNatureShow) {
        this.enterpriseNatureShow = enterpriseNatureShow;
    }

    public String getIsQualityShow() {
        if(null != isQuality){
            return 1 == isQuality ? "是否优质企业【是】;" : "是否优质企业【否】;";
        }else {
            return "";
        }
    }

    public void setIsQualityShow(String isQualityShow) {
        this.isQualityShow = isQualityShow;
    }

    public String getWagesPayFormShow() {
        return StringUtils.isNotEmpty(wagesPayForm) ? "工资发放形式【" + wagesPayForm + "】;" : "";
    }

    public void setWagesPayFormShow(String wagesPayFormShow) {
        this.wagesPayFormShow = wagesPayFormShow;
    }

    public String getWagesShow() {
        return null != getWages() ? "工资【" + getWages() + "元】;" : "";
    }

    public void setWagesShow(String wagesShow) {
        this.wagesShow = wagesShow;
    }

    public String getCivilianSoldierShow() {
        if(null != civilianSoldier){
            return 1 == civilianSoldier ? "是否文职军人【是】;" : "是否文职军人【否】;";
        }else {
            return "";
        }
    }

    public void setCivilianSoldierShow(String civilianSoldierShow) {
        this.civilianSoldierShow = civilianSoldierShow;
    }

    public String getOwnIdCardShow() {
        if(null != ownIdCard){
            return 1 == ownIdCard ? "是否有身份证【是】;" : "是否有身份证【否】;";
        }else {
            return "";
        }
    }

    public void setOwnIdCardShow(String ownIdCardShow) {
        this.ownIdCardShow = ownIdCardShow;
    }

    public String getFrontShow() {
        String jobNatureAppend = "";
        if(StringUtils.isNotEmpty(jobNature)){
            switch (jobNature){
                case "工薪"://工薪族
                    jobNatureAppend = "有工作：" + getJobNatureShow() + getEnterpriseNatureShow() + getIsQualityShow() + getWagesPayFormShow() + getWagesShow();
                    break;
                case "个体户"://个体户
                    jobNatureAppend = "有工作：" + getJobNatureShow() + getStartOperateTimeShow() + getOperatingStreamShow() + getBusinessLicenseShow() + getManagementIndustryShow();
                    break;
                case "企业主"://企业主
                    jobNatureAppend = "有工作：" + getJobNatureShow() + getStartOperateTimeShow() + getOperatingStreamShow() + getBusinessLicenseShow() + getTotalSharesShow() + getManagementIndustryShow();
                    break;
                case "军人"://军人
                    jobNatureAppend = "有工作：" + getJobNatureShow() + getCivilianSoldierShow() + getOwnIdCardShow();
                    break;
                default:
                    return "";
            }
            return jobNatureAppend;
        }else {
            return "";
        }
    }
}